<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>充值记录</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/default/easyui.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/themes/icon.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/plugins/jQuery/demo.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/admin/css/form.css"/>
	
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath }/plugins/jQuery/jquery.easyui.min.js"></script>
	<script src="${pageContext.request.contextPath}/plugins/jQuery/easyui-lang-zh_CN.js"></script>
	
	<script type="text/javascript">
	
	   $(function(){
	   
	        $('#recharge_type').combobox({
				valueField:'dict_code', //值字段
				textField:'dict_name', //显示的字段
				url:'${pageContext.request.contextPath}/dict/item/CHANGE_TYPE',
				onLoadSuccess : function(data) {
		            $('#recharge_type').combobox("setValue",-1);
	        	}
	        });

			loadTable();
			$('#dlg').dialog('close');
			
	    });
		
		function loadTable(){
		   var acct_id = '${acct_id}';
			$('#dg').datagrid({
				rownumbers:true,
				singleSelect:true,
				pagination:true,
				pageSize:20,
				pageList:[10,20,30,50,100],
		 		url:'${pageContext.request.contextPath }/admin/acct/rechargerd?acct_id='+acct_id,
		 		queryParams:{
		 			 start_time:$("#start_time").textbox('getValue'),
		 			 end_time:$("#end_time").textbox('getValue'),
		 			 recharge_type:$('#recharge_type').combobox("getValue"),
		 		},
	    		columns:[[
	    		    {field:'create_time',title:'时间',align:'center',width:140},
					{field:'cust_name',title:'客户姓名',align:'center',width:90},
					{field:'mobile',title:'联系电话',align:'center',width:100},
					{field:'station_name',title:'所属站点',align:'center',width:100},
					{field:'amount',title:'充值金额',align:'center',width:100},
					{field:'recharge_typename',title:'充值类型',width:130,align:'center'},
					{field:'username',title:'操作人',width:130,align:'center'}
					
	 			]],
				onLoadSuccess:function(data){  
			        //添加“合计”列
				}
			});
		}
		
		function showImg(imgUrl){
			$('#dlg').dialog('open');
			var image=document.getElementById("stationImg");
			var src="${pageContext.request.contextPath }"+imgUrl;
			image.setAttribute("src",src );
		}

		// 打开一个新的选项卡，并制定选项卡的名称
		function show(url,name){
			parent.window.addTab(name,url);
		}
		
		function findData(){
			loadTable();
		}
		
	   function myformatter(date){  
		      var y = date.getFullYear();  
		      var m = date.getMonth()+1;  
		      var d = date.getDate();  
		      return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);  
	   }  
	          
	   function myparser(s){  
		    if (!s) return new Date();  
		    var ss = (s.split('-'));  
		    var y = parseInt(ss[0],10);  
		    var m = parseInt(ss[1],10);  
		    var d = parseInt(ss[2],10);  
		    if (!isNaN(y) && !isNaN(m) && !isNaN(d)){  
		        return new Date(y,m-1,d);  
		    } else {  
		        return new Date();  
		    }  
	  } 

	</script>
	<style type="text/css">
		body{
		font-family:'微软雅黑';}
	</style>
  </head>
  
  <body>
	<table id="dg" toolbar="#searchtool" loadMsg="正在查询..." style="width:950px;height:auto;"></table>
	
	<div id="searchtool" style="padding:5px; height:auto;">  
       <span style="margin:0px 12px;">时间:</span><input id="start_time" class="easyui-datebox" data-options="formatter:myformatter,parser:myparser" style="width:120px"> -- <input id="end_time" class="easyui-datebox" data-options="formatter:myformatter,parser:myparser" style="width:120px">
       <span style="margin:0px 12px;">充值方式:</span><input id="recharge_type" class="easyui-textbox" style="width:180px;height:26px"/> 
       <a href="javascript:findData()" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:100px;margin:0px 3px;">查询</a>
       <a href="javascript:history.go(-1)" class="easyui-linkbutton" data-options="iconCls:'icon-back'" style="width:120px;margin:0px 3px;">返回客户列表</a>
    </div>
  </body>
</html>
